Street lights in two streets using a PIC16F84A in assembly language

This tutorial is to help us on how to design, build, and code in assembly languages street lights connected to a PIC16F84A microcontroller. Firstly, you will design the schematic below on proteus software and save it.
You need to watch the video above in order to understand how this circuit works.


Arduino Christmas

In this project, you will need

  1. a PIC16F84A microcontroller.
  2. two capacitors and a crystal oscillator: used to produce an input clock frequency into the microcontroller
  3. two street lights of colors : green, orange, red.
  4. a push-button and a 10K ohm resistor: it resets the microcontroller in case of any failure


Here, I am going to explain the code fraction by fraction.

In this project,

  • When green of street A is ON, red of street B is also ON.
  • green of street A turns OFF and emmidiately, orange turns ON. While red on street B is still ON.
  • When orange on street A is turned OFF, red of street A is ON and green of street B is ON.
  • The process continues.
  • Here is a timming diagram for the process. traffic time diagram.png

Just copy the code below and compile it on MPLab IDE to generate the HEX file, then burn it to the PIC and enjoy your success.

Click on the link below to download the